#include <stdio.h>
#include <math.h>

int isPrime(int n)
{
	if ( n == 1)
	{
		return 0;
	}
	
	int ret = 1;
	for ( int i = 2; i <= (int)sqrt(n); i++ )
	{
		if ( n % i == 0 )
		{
			ret = 0;
			break;
		}
	}
	return ret;
}

int main()
{
	int data[1000];
	int n = 0;
	scanf("%d", &n);
	for ( int i = 0; i < n; i++ )
	{
		scanf("%d", &data[i]);
	}
	
	for ( int i = 0; i < n; i++ )
	{
		if ( isPrime(data[i]) == 1 )
		{
			printf("yes\n");
		}
		else
		{
			printf("no\n");
		}
	}
	return 0;
}
